#if($msg)
<script>
alert('$!msg');
</script>
#end
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>编辑用户</title>
<link href="/include/manage/images/main/style.css" rel="stylesheet" type="text/css" />
<link href="/include/manage/dialog/asyncbox.css" type="text/css" rel="stylesheet" />
<script language="javascript" src="/include/manage/js/jquery.js"></script>
<script type="text/javascript" src="/include/manage/datepicker/WdatePicker.js"></script>
<script type="text/javascript" src="/include/manage/js/AsyncBox.js"></script>
<script type="text/javascript">
$(function(){
	$('#chooseType').click(function(){
		asyncbox.open({
			title : '选择频道',
			url : '/manage_type_ajax.ad?parameter=showList&checkStyle=checkbox&uid=$!user.id',
			width : 400,
			height : 300,
			modal : true,
			tipsbar:{
				title : '选择频道',
				content : '选择用户可管理的频道'
				},
		　　btnsbar : jQuery.btn.OKCANCEL,
		　　callback : function(action,iframe){
		　　　　　if(action == 'ok'){
		　　　　　　　var s='';
					var str='';
					var nodes = iframe.zTree1.getCheckedNodes();
					for(var i=0;i<nodes.length;i++){
						s+=nodes[i].name+",";
						str+=nodes[i].id+",";
					}
					jQuery("#showTypename").val(s);
					jQuery("#adminType").val(str);
		　　　　　}
		　　　}
		});
	});
});

function checkForm(){
	if($("#username").val().length==0){
		alert("用户名不能为空！");
		$("#username")[0].focus();
		return false;
	}
	if($("#password").val().length==0){
		alert("密码不能为空！");
		$("#password")[0].focus();
		return false;
	}
}
</script>
</head>
<body>
<form name="writeform" method="post" action="/manage_user.ad" onSubmit="return checkForm()">
<input type="hidden" name="parameter" value="$!action" />
<input type="hidden" name="id" value="$!user.id" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" background="/include/manage/images/main/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="30"><img src="/include/manage/images/main/tab_03.gif" width="12" height="30" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><div align="center"><img src="/include/manage/images/main/tb.gif" width="16" height="16" /></div></td>
                <td width="95%"><span class="STYLE3">当前位置</span>：[用户管理]-[编辑用户]</td>
              </tr>
            </table></td>
            <td width="54%">#if($pop==3)<table border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_user.ad?parameter=add&tid=$!tid"><img src="/include/manage/images/main/22.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_user.ad?parameter=add&tid=$!tid">新增</a></div></td>
                  </tr>
                </table></td>
				#if($user.username!="admin")
                <td width="52"><table width="88%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_user.ad?parameter=delete&id=$!user.id"><img src="/include/manage/images/main/11.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_user.ad?parameter=delete&id=$!user.id">删除</a></div></td>
                  </tr>
                </table></td>
				#end
              </tr>
            </table>#end</td>
          </tr>
        </table></td>
        <td width="16"><img src="/include/manage/images/main/tab_07.gif" width="16" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
  	<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="8" background="/include/manage/images/main/tab_12.gif">&nbsp;</td>
        <td>
	<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#b5d6e6">
#if($pop==3)
    <tr>
      <td width="20%" height="25" bgcolor="#ffffff">&nbsp;权限组：</td>
      <td bgcolor="#ffffff">&nbsp;
         <select name="popedom" id="popedom">
         	<option value="0"#if($tid.equals("0")) selected#end>频道编辑</option>
            <option value="1"#if($tid.equals("1")) selected#end>频道审核员</option>
            <option value="2"#if($tid.equals("2")) selected#end>频道管理员</option>
            <option value="3"#if($tid.equals("3")) selected#end>超级管理员</option>
         </select>
         <font color="#FF0000">*</font>
      </td>
    </tr>
#end
    <tr> 
      <td width="20%" height="25" bgcolor="#ffffff">&nbsp;用户名：</td>
      <td bgcolor="#ffffff">&nbsp;
      #if($pop>=2)
         <input name="username" type="text" id="username" value="$!user.username" />
      #else
      	<input name="username" type="hidden" id="username" value="$!user.username" />$!user.username
      #end
				 <!--input type="button" name="chooseName" value="选择用户" /-->
         <font color="#FF0000">*</font>
      </td>
    </tr>
	#if($pop>=2)
		#if($action=="update")
		#if($tid=="0" || $tid=="1")
    <tr>
      <td width="20%" height="25" bgcolor="#ffffff">&nbsp;管理频道：</td>
      <td bgcolor="#ffffff">&nbsp;<input type="hidden" id="adminType" name="adminType" value="$!user.getTypeID()" />
         <input name="showTypename" type="text" id="showTypename" disabled value="$!user.getTypename()" />
				 <input type="button" id="chooseType" name="chooseType" value="选择频道" />
         <font color="#FF0000">*</font>
      </td>
    </tr>
		#end
		#end
	<tr>
      <td height="25" bgcolor="#ffffff">&nbsp;密 &nbsp;码：</td>
      <td bgcolor="#ffffff">&nbsp;
        <input name="password" type="text" id="password" value="$!user.password" />
        <font color="#FF0000">*</font></td>
    </tr>
	#else
    <tr>
      <td width="20%" height="25" bgcolor="#ffffff">&nbsp;管理频道：</td>
      <td bgcolor="#ffffff">&nbsp;$!user.getTypename()
		<input type="hidden" name="password"#if($user.password) value="$!user.password"#else value="123456"#end />
		</td>
	</tr>
	#end
	<tr>
    	<td height="25" bgcolor="#ffffff">&nbsp;任意文件：</td>
        <td bgcolor="#ffffff">&nbsp;
        <input name="document_show" id="document_not_show" type="radio" value="0"#if($!user.document_show)#if($!user.document_show==0) checked#end#else checked#end /><label for="document_not_show">不显示</label>&nbsp;
      	<input name="document_show" id="document_is_show" type="radio" value="1" #if($!user.document_show)#if($!user.document_show==1) checked#end#end /><label for="document_is_show">显示</label>
      </td>
    </tr>
    <!--tr>
      <td height="25" bgcolor="#ffffff">&nbsp;Email&nbsp;：</td>
      <td bgcolor="#ffffff">&nbsp;
        <input name="email" type="text" id="email" value="$!user.email" />
       </td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#ffffff">&nbsp;QQ&nbsp;&nbsp;&nbsp;&nbsp;：</td>
      <td bgcolor="#ffffff">&nbsp;
        <input name="qq" type="text" id="qq" value="$!user.qq" />
      </td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#ffffff">&nbsp;电&nbsp;&nbsp;话：</td>
      <td bgcolor="#ffffff">&nbsp;
        <input name="tel" type="text" id="tel" value="$!user.tel" />
      </td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#ffffff">&nbsp;出生年月：</td> 
      <td bgcolor="#ffffff">&nbsp;
        <input name="birthday" type="text" id="birthday" value="$!user.birthday" class="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
      </td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#ffffff">&nbsp;传 &nbsp;真：</td>
      <td bgcolor="#ffffff">&nbsp;
        <input name="fax" type="text" id="fax" value="$!user.fax" />
      </td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#ffffff">&nbsp;地&nbsp;&nbsp;址：</td>
      <td bgcolor="#ffffff">&nbsp;
        <input name="addr" type="text" id="addr" value="$!user.addr" /></td>
    </tr>
    <tr> 
      <td bgcolor="#ffffff">&nbsp;个人说明：</font></td> 
      <td bgcolor="#ffffff"><textarea name="intro" cols="50" rows="5" id="intro">$!user.intro</textarea> 
      </td>
    </tr-->
  </table>
		</td>
        <td width="8" background="/include/manage/images/main/tab_15.gif">&nbsp;</td>
      </tr>
    </table></td>
    </tr>
  <tr>
    <td height="35" background="/include/manage/images/main/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="35"><img src="/include/manage/images/main/tab_18.gif" width="12" height="35" /></td>
        <td valign="top">
        #if($pop>=2)
        <div align="center"> 
          <input type="submit" name="Submit" value="保存" />
          &nbsp; &nbsp; 
          <input type="reset" name="Reset" value="重写" />
        </div>
        #end
        </td>
        <td width="16"><img src="/include/manage/images/main/tab_20.gif" width="16" height="35" /></td>
      </tr>
    </table>
	</td>
  </tr>
</table>
</form>
</body>
</html>